{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-05-27T04:57:22.797211Z",
     "start_time": "2018-05-27T04:57:22.554798Z"
    }
   },
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import cv2\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "np.random.seed(0)\n",
    "%matplotlib inline"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-05-27T04:57:22.947764Z",
     "start_time": "2018-05-27T04:57:22.798520Z"
    }
   },
   "outputs": [],
   "source": [
    "import sys\n",
    "sys.path.append('../src/')\n",
    "\n",
    "from utils import gen_mask, coloring"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-05-27T04:57:22.990015Z",
     "start_time": "2018-05-27T04:57:22.948839Z"
    }
   },
   "outputs": [],
   "source": [
    "n_sticks = 8\n",
    "height = 256\n",
    "width = 256\n",
    "\n",
    "while True:\n",
    "    img = np.ones((height, width), dtype=np.uint8) * 255\n",
    "    ins = np.zeros((0, height, width), dtype=np.uint8)\n",
    "    for _ in range(n_sticks):\n",
    "        x = np.random.randint(30, 225)\n",
    "        y = np.random.randint(30, 225)\n",
    "        w = 15\n",
    "        h = np.random.randint(80, 100)\n",
    "        theta = np.random.randint(-90, 90)\n",
    "        rect = ([x, y], [w, h], theta)\n",
    "        box = np.int0(cv2.boxPoints(rect))\n",
    "\n",
    "        gt = np.zeros_like(img)\n",
    "        gt = cv2.fillPoly(gt, [box], 1)\n",
    "        ins[:, gt != 0] = 0\n",
    "        ins = np.concatenate([ins, gt[np.newaxis]])\n",
    "        img = cv2.fillPoly(img, [box], 255)\n",
    "        img = cv2.drawContours(img, [box], 0, 0, 2)\n",
    "\n",
    "    if np.sum(np.sum(ins, axis=(1, 2)) < 400) == 0:\n",
    "        break"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-05-27T04:57:23.202795Z",
     "start_time": "2018-05-27T04:57:22.991022Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.image.AxesImage at 0x7ff90769c828>"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAA20AAAEYCAYAAADPgh6RAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAIABJREFUeJzt3V/IZFeZ7/Hf0+nACRkwrfbgmYtIOAwjaAZiCj0Qg41HTRsIx7mQg3+ixovIzMjg2N4MHOHcj2BARM2Fmclo4ECIf3IYpy8iEk2i8jZ94c0EnYPenBE7THoIQaUHn3PxVnXqrdSf/WftvZ611vcDL6Tf1Fu1dlXtp/avnrXXNncXAAAAACCmU7kHAAAAAADYjdAGAAAAAIER2gAAAAAgMEIbAAAAAARGaAMAAACAwAhtAAAAABAYoQ0AAAAAAksa2szsgpn9wMy+kPJ+AWAMahOAqKhPALpIFtrM7HWSzrv73ZLOmNkdqe4bAIaiNgGIivoEoKuUnba3SXrKzG6RdJukuxLeNwAMRW0CEBX1CUAnpxPe1xlJVyVdkPSQpNvX/6eZPSjpQUm6+eab73zTm96U8KEBRHDp0qUX3P1s7nFs2FubpJP1SdKd8w0NwFzc3XKPYYvOx06iNgFV6lqbUoa2q5L+UtKnJP0XSS9uDOhhSQ9L0mKx8KOjo4QPDSACM/tl7jFssbc2SSfrk5n5rKMD0LLOx07UJqBtKadHHkl6yd0vS3qvpOcS3jcADEVtAhAV9QlAJ8lCm7v/WtLTZvaspGvuTisNQHbUJgBRUZ8AdGXu83fbmR4J1MnMLrn7Ivc4xmAKElCnoOe0dUZtAurUt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+I1WBaisO8nd3/G3Z9Y/vO0pKsq6/nfHP9rVNDzP0Cp21JcbZKoT7lRn4pT4rZQmzKgNuU1ZW3KEdrO6PgFuCDpIUmvzTCGIX4n6TPu/o7lf79G5W3Htud+9btPS/qiYm/H5mtwXgW8n8zsZh3vkLeowOd/bfzfVoHPfw+lbksNtUmiPmVBfSpGidtCbYqB2pTBFLUpR2i7Kul+SU9IukHSixnG0Ju7v+zu31r+86KOU35p27Htub8q6T06/sbiZQXeji2vwe0K/n4yM5P0JUmfk3RFhT3/6+N3938v7fnvqchtqaQ2SdSn2VGfilLctlCbYqA2zW+q2pQjtB1JesndL0t6r6TnMoyhNzM7a2b3Lv/5dkn/rPK2Y9tz/zNJ13T8Rgq9HVteg58r/vvp8zqe2/xjlfn8Xx9/oc9/H0VuSyW1SSpz/7iu0P2D+lSO4raF2hRDofsGtWmL2UObu/9a0tNm9qyka+5+NPcYBroq6QNm9pykN+s4HRe1Hduee3e/JukrOn7D/KmO27hRbb4G34n8fjKzd0v6uKTPmtn3dXzCbDHP/5bxn1NBz39fBW9L8bVJoj7NjfpUlkK3hdoUA7VpRlPWJi6uDQAAAACBcXFtAAAAAAiM0AYAAAAAgRHaAAAAACAwQhsAAAAABEZoAwAAAIDACG0AAAAAEBihDQAAAAACI7QBAAAAQGD/HzUpM8seJh2JAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 1080x1080 with 3 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "fig, axes = plt.subplots(1, 3, figsize=(15, 15))\n",
    "plt.gray()\n",
    "\n",
    "axes[0].imshow(img)\n",
    "axes[1].imshow(np.sum(ins, axis=0))\n",
    "axes[2].imshow(coloring(gen_mask(ins)))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "python3.6",
   "language": "python",
   "name": "python3.6"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.4"
  },
  "toc": {
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": "block",
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
